package com.kk.solr.service;

import com.kk.solr.service.dto.SolrFileQueryCriteria;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.common.SolrDocumentList;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

public interface SolrService {
    /**
     * solr查询
     */
    SolrDocumentList querySolrAdvance(String collection, SolrFileQueryCriteria criteria, Pageable pageable) throws IOException, SolrServerException;

    /**
     * 删除全部索引，然后重建
     */
    boolean reIndex(String collection) throws IOException, SolrServerException;

    /**
     * 增量更新索引
     */
    boolean deltaIndex(String collection) throws IOException, SolrServerException;

    /**
     * 上传文件到solr服务器
     */
    boolean upload(MultipartFile[] multipartFile);
}
